package com.itkun.controller.utils;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
//作为springMVc的异常处理器
@RestControllerAdvice
public class ProjectExceptionAdvice {
    @ExceptionHandler(Exception.class)
    public R doException(Exception ex){
        //记录日志
       //通知运维
       // 通知研发
        ex.printStackTrace();
        return new R("服务器故障，请稍后重试");
    }
}
